<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <title>党费信息查询</title>
    <link href="/resources/bootstrap-3.3.5-dist/css/bootstrap.min.css" title="" rel="stylesheet"/>
    <link title="" href="/resources/css/style.css" rel="stylesheet" type="text/css"/>
    <link title="blue" href="/resources/css/dermadefault.css" rel="stylesheet" type="text/css"/>
    <link title="green" href="/resources/css/dermagreen.css" rel="stylesheet" type="text/css" disabled="disabled"/>
    <link title="orange" href="/resources/css/dermaorange.css" rel="stylesheet" type="text/css" disabled="disabled"/>
    <link href="/resources/css/templatecss.css" rel="stylesheet" title="" type="text/css"/>
    <script src="/resources/script/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="/resources/script/jquery.cookie.js" type="text/javascript"></script>
    <script src="/resources/bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            var insertmessage = "<%=session.getAttribute("insertmessage")%>";
            var editmassage = "<%=session.getAttribute("editmassage")%>";
            console.log("===提示信息====" + insertmessage)
            console.log("===提示信息====" + editmassage)
            if (insertmessage == "success") {
                alert("添加成功！");
            }
            if (insertmessage == "isRepete") {
                alert("已存在，请重新添加！");
            }
            if (insertmessage == "isEmpty") {
                alert("数据为空，请重新填写！");
            }
            if (editmassage == "success") {
                alert("修改成功！");
            }
            if (editmassage == "isRepete") {
                alert("已存在，请重新添加！");
            }
            if (editmassage == "isEmpty") {
                alert("数据为空，请重新填写！");
            }
        })
    </script>
</head>

<body>
<nav class="nav navbar-default navbar-mystyle navbar-fixed-top">
    <div class="navbar-header">
        <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand mystyle-brand"><span class="glyphicon glyphicon-home"></span></a></div>
    <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
            <li class="li-border"><a class="mystyle-color" href="/index">高校党员信息管理系统</a></li>
        </ul>
        <ul class="nav navbar-nav pull-right">
            <li class="dropdown li-border"><a href="#" class="dropdown-toggle mystyle-color" data-toggle="dropdown">缴纳党费<span
                class="caret"></span></a>
                <ul class="dropdown-menu">
                    <li><a href="/money/goAddMoney">去缴纳</a></li>
                </ul>
            </li>
            <li class="dropdown li-border"><a href="#" class="dropdown-toggle mystyle-color" data-toggle="dropdown">${user.userName}<span
                class="caret"></span></a>
                <ul class="dropdown-menu">
                    <li><a href="/outLogin">退出</a></li>
                </ul>
            </li>
        </ul>
    </div>
</nav>
<div class="down-main">
    <div class="left-main left-full">
        <div class="sidebar-fold"><span class="glyphicon glyphicon-menu-hamburger"></span></div>
        <div class="subNavBox">
            <div class="sBox">
                <div class="subNav sublist-down"><span class="title-icon glyphicon glyphicon-chevron-down"></span><span
                    class="sublist-title">我的中心</span>
                </div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>首页</div>
                        <a href="/index"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">首页</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>个人资料</div>
                        <a href="/user/goUserInfo"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">个人资料</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>修改密码</div>
                        <a href="/user/goPassword"><span class="sublist-icon glyphicon glyphicon-credit-card"></span><span
                            class="sub-title">修改密码</span></a>
                    </li>

                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">党费信息</span></div>
                <ul class="navContent" style="display:block">
                    <li class="active">
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党费信息查询
                        </div>
                        <a href="/money/myMoneyList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党费信息查询</span></a>
                    </li>
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党费缴纳</div>
                        <a href="/money/goAddMoney"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党费缴纳</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">通知查询</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>查看通知</div>
                        <a href="/notice/qtNoticeList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">查看通知</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">党员成绩信息</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>党员成绩查询</div>
                        <a href="/partygrade/myGradeList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">党员成绩查询</span></a>
                    </li>
                </ul>
            </div>
            <div class="sBox">
                <div class="subNav sublist-up"><span class="title-icon glyphicon glyphicon-chevron-up"></span><span
                    class="sublist-title">个人操作日志</span></div>
                <ul class="navContent" style="display:none">
                    <li>
                        <div class="showtitle" style="width:100px;"><img src="/resources/img/leftimg.png"/>个人操作日志</div>
                        <a href="/option/myOptionList"><span class="sublist-icon glyphicon glyphicon-user"></span><span
                            class="sub-title">个人操作日志</span></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="right-product view-product right-full">
        <div class="container-fluid">
            <div class="info-center">
                <div class="page-header">
                    <div class="pull-left">
                        <h4><strong style="font-family: STXingkai;font-size: 30px; ">党费缴纳查询</strong></h4>
                    </div>
                </div>
                <div class="indentify-class padding-lr">
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-responsive table-hover" align="center">
                                <tr>
                                    <th>序号</th>
                                    <th>缴纳时间</th>
                                    <th>用户账号</th>
                                    <th>缴纳标准</th>
                                    <th>缴纳情况</th>
                                    <th>备注</th>
                                    <th>操作</th>
                                </tr>
                                <c:forEach var="moneyInfo" items="${moneyPageInfo.list}">
                                    <tr>
                                        <td>${moneyInfo.moneyId}</td>
                                        <td><span data-toggle="tooltip" title="缴纳时间">${moneyInfo.moneyYear}-${moneyInfo.moneyMonth}</span></td>
                                        <td><span data-toggle="tooltip" title="用户账号">${moneyInfo.moneyName}</span></td>
                                        <td><span data-toggle="tooltip" title="缴纳标准">${moneyInfo.moneyStandard}</span></td>
                                        <td><span data-toggle="tooltip" title="缴纳情况">${moneyInfo.moneyCase}</span></td>
                                        <td><span data-toggle="tooltip" title="备注">${moneyInfo.moneyNote}</span></td>
                                        <td>
                                            <a href="javascript:void(0);" onclick="looks(${moneyInfo.moneyId})" class="btn btn-info btn-xs"
                                               style=""><span class="glyphicon glyphicon-edit"
                                                              aria-hidden="true"></span>查看-修改</a>
                                            <a href="javascript:void(0);" onclick="deletes(${moneyInfo.moneyId})"
                                               class="btn btn-danger btn-xs"
                                               style=""><span class="glyphicon glyphicon-remove"
                                                              aria-hidden="true"></span>删除</a>
                                        </td>

                                    </tr>
                                </c:forEach>

                                <tr>
                                    <td colspan="7" align="right">
                                        当前${moneyPageInfo.pageNum }页,总${moneyPageInfo.pages }页,总${moneyPageInfo.total }条记录
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="7" align="center">
                                        <ul class="pagination">
                                            <li><a
                                                href="/money/myMoneyList?page=1">首页</a>
                                            </li>
                                            <!-- 判断是否有上一页，以便显示点击按钮 -->
                                            <c:if test="${moneyPageInfo.hasPreviousPage }">
                                                <li>
                                                    <a href="/money/myMoneyList?page=${moneyPageInfo.pageNum-1 }"
                                                       aria-label="Previous">
                                                        <span aria-hidden="true">&laquo;</span>
                                                    </a>
                                                </li>
                                            </c:if>
                                            <!-- 遍历页码 -->
                                            <c:forEach items="${moneyPageInfo.navigatepageNums }" var="page_Num">
                                                <c:if test="${page_Num == moneyPageInfo.pageNum }">
                                                    <li class="active"><a href="#">${page_Num }</a></li>
                                                </c:if>
                                                <c:if test="${page_Num != moneyPageInfo.pageNum }">
                                                    <li><a
                                                        href="/money/myMoneyList?page=${page_Num }">${page_Num}</a>
                                                    </li>
                                                </c:if>
                                            </c:forEach>
                                            <!-- 判断是否有下一页 -->
                                            <c:if test="${moneyPageInfo.hasNextPage }">
                                                <li>
                                                    <a href="/money/myMoneyList?page=${moneyPageInfo.pageNum+1 }"
                                                       aria-label="Next">
                                                        <span aria-hidden="true">&raquo;</span>
                                                    </a>
                                                </li>
                                            </c:if>

                                            <li><a
                                                href="/money/myMoneyList?page=${moneyPageInfo.pages }">末页</a>
                                            </li>
                                        </ul>

                                    </td>
                                </tr>

                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        /*左侧导航栏显示隐藏功能*/
        $(".subNav").click(function () {
            /*显示*/
            if ($(this).find("span:first-child").attr('class') == "title-icon glyphicon glyphicon-chevron-down") {
                $(this).find("span:first-child").removeClass("glyphicon-chevron-down");
                $(this).find("span:first-child").addClass("glyphicon-chevron-up");
                $(this).removeClass("sublist-down");
                $(this).addClass("sublist-up");
            }
            /*隐藏*/
            else {
                $(this).find("span:first-child").removeClass("glyphicon-chevron-up");
                $(this).find("span:first-child").addClass("glyphicon-chevron-down");
                $(this).removeClass("sublist-up");
                $(this).addClass("sublist-down");
            }
            // 修改数字控制速度， slideUp(500)控制卷起速度
            $(this).next(".navContent").slideToggle(300).siblings(".navContent").slideUp(300);
        })
        /*左侧导航栏缩进功能*/
        $(".left-main .sidebar-fold").click(function () {

            if ($(this).parent().attr('class') == "left-main left-full") {
                $(this).parent().removeClass("left-full");
                $(this).parent().addClass("left-off");

                $(this).parent().parent().find(".right-product").removeClass("right-full");
                $(this).parent().parent().find(".right-product").addClass("right-off");

            } else {
                $(this).parent().removeClass("left-off");
                $(this).parent().addClass("left-full");

                $(this).parent().parent().find(".right-product").removeClass("right-off");
                $(this).parent().parent().find(".right-product").addClass("right-full");

            }
        })

        /*左侧鼠标移入提示功能*/
        $(".sBox ul li").mouseenter(function () {
            if ($(this).find("span:last-child").css("display") == "none") {
                $(this).find("div").show();
            }
        }).mouseleave(function () {
            $(this).find("div").hide();
        });

        $("[data-toggle='tooltip']").tooltip();
    })

    //查看
    function looks(id) {
       // alert(id + "==========");
        location.replace("/money/goEdit?moneyId=" + id)

    }
    //删除
    function deletes(id) {
       // alert(id + "==========");
        if (confirm("请确认操作")) {
            $.ajax({
                url: '/money/myRemove',
                data: {
                    moneyId: id,
                },
                type: 'post',
                dataType: 'json',
                success: function (data) {
                    if (data.errno == 0) {
                        alert(data.message);
                        location.reload()
                    } else {
                        alert(data.message);
                    }
                }
            });
        } else {
            location.reload()
        }
    }
</script>
</body>
</html>
